<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>大象与猩猩 | 分享页</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<link rel="stylesheet" href="../../bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="../../assets/css/amazeui.min.css" />
</head>
<body>
	<h2 class="am-kai am-text-lg">  该团号为<span id="groupId" class="am-badge am-badge-primary"></span></h2>
	<div class="am-g" style="padding: 1%;">
		<div class="am-u-sm-12" style="padding: 0%;">
			<div class="thumbnail">
				<img alt="" id="productImage" style="width: 100%">

				<div class="caption">
					<p>
						团长：<span id="captainName"></span>
					</p>

					<p>
						团类型：<span id="personAmount"></span>
					</p>

					<p>
						已参团人数：<span id="orders"></span> (人)
					</p>

					<p>
						团购价：<span id="personPrice"></span>
					</p>
					<p>
						截止时间：<span id="deadline"></span>
					</p>
					<p>
						余货：<span id="balance"></span>（个）
					</p>
				</div>
			</div>
		</div>

		<div class="am-u-sm-12" style="padding: 0%;">
			<div class="am-g am-u-sm-12  am-u-sm-centered">
				<label class="am-kai am-text-success am-text-lg">商品详情</label>
			</div>
			<div class="am-u-avg-sm-4 am-u-avg-md-4 am-u-avg-lg-4">
				<p>
					<font size="4"><b>产品：</b> </font><font size="4"><span id="productDescription"></span></font>
				</p>
				<p>
					<font size="4"><b>原价：</b> </font><font size="4">￥ <span id="productPrice"></span></font>
				</p>
				<p>
					<font size="4"><b>规格：</b> </font><font size="4"><span id="productSpecification"></span></font>
				</p>
				<p>
					<font size="4"><b>简介：</b> </font><font size="4"><span id="productNote"></span></font>
				</p>
				<p></p>

			</div>
		</div>
	</div>
	<hr/>
	
	<h2>① 关注微信号。扫描下面的图片：</h2>
	<img class="am-u-sm-centered" src="concern.png">
	<h2>② 进入公众号，下载app</h2>
	<img class="am-u-sm-centered" src="download.png">
	<h2>③ 在app内登录</h2>
	<img class="am-u-sm-centered" src="login.png">
	<h2>④ 点击开团吧</h2>
	<img class="am-u-sm-centered" src="attendGroup.png">
	<h2>
		⑤ 输入团号 <span id="groupId2" class="am-badge am-badge-primary am-text-lg"></span>，参团吧
	</h2>
	<img class="am-u-sm-centered" src="typeGroupNumber.png">
	<h2>⑥ 完成付款，凑齐团员数</h2>
	<img class="am-u-sm-centered" src="groupDone.png">

	<script src="../../../resources/js/zepto1.1.6.min.js"></script>
	<script src="../../configService.js"></script>
	<script type="text/javascript">
		var groupIdThings = window.location.search.split("=")[1];
		var groupId = groupIdThings.split("&")[0];
		$("#groupId").append(groupId);
		$("#groupId2").append(groupId);
		$.ajax({
			type : "GET",
			url : "../../../groupinstance/check?groupinstanceId=" + groupId,
			success : function(data) {
				console.log(data);
				if (data.code == 1) {
					
						 $.ajax({
							type : "GET",
							url : "../../../groupinstance/get?groupinstanceId=" + groupId,
							success : function(data) {
								console.log(data);
								if(data.code==1){
									$("#orders").text(data.object.length);
								}else{
									sweetAlert(data.info);
								}
							},
							error:function(){
								
							}
						});
						
						$("#productImage").attr("src",zUrl+data.object.group.product.thumbId+"?p=0");
						$("#captainName").text(data.object.captain.username);
						$("#personAmount").text(data.object.group.personAmount+"人团");
						$("#captainName").text(data.object.captain.name);
						$("#personPrice").text(data.object.group.personPrice+"元");
						$("#deadline").text(new Date(data.object.group.deadline).toLocaleString());
						$("#balance").text(data.object.group.balance);
						
						$("#productDescription").text(data.object.group.product.description);
						$("#productPrice").text(data.object.group.product.price);
						$("#productSpecification").text(data.object.group.product.specification);
						$("#productNote").text(data.object.group.product.note);
				} else {
					alert(data.info);
					return;
				}
			},
			error : function(data) {
			}
		});
	</script>
</body>
</html>
